<pre>
<script>

var str = "Hello, world!\n";
document.write(str);

str = "Hoge\n";
document.write(str);

str = "Foo\n";
document.write(str);

</script>
</pre>